<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	template="/layout/template.xhtml">

	<ui:define name="content">
		<f:view>


			<h:form>

				<h2><h:outputText value="#{global.accesslog_view_title}" /></h2>


				<rich:dataTable id="datatable_id" columns="7"
					value="#{accessLogMB.accessLogs}" var="record">
					
					
					<rich:column style="width:300px;"  sortBy="#{record.id}" sortable="true" sortExpression="#{record.id}">
						<f:facet name="header">
							<h:outputText value="Name" />
						</f:facet>
						<h:commandLink action="/pages/accesslog">
							<h:outputText value="#{record.name}" />
							 <f:setPropertyActionListener target="#{accessLogMB.accessLog}" value="#{record}" />
						</h:commandLink>
					</rich:column>
					
					
					<rich:column>
						<f:facet name="header">
							<h:outputText value="#{global.accesslog_lastscan}" />
						</f:facet>
							<h:outputText value="#{record.lastscan.time}" >
							<f:convertDateTime timeZone="#{global.timeZone}"
								pattern="#{global.dateTimePattern}" />
							</h:outputText>
					</rich:column>
					
					<rich:column>
						<f:facet name="header">
							<h:outputText value="#{global.accesslog_count}" />
						</f:facet>
							<h:outputText value="#{record.totalcount}" />
					</rich:column>
				
				
					<rich:column>
						<f:facet name="header">
							<h:outputText value="#{global.accesslog_duration}" />
						</f:facet>
							<h:outputText value="#{record.lastscanduration} ms" />
					</rich:column>
						
						
					

				

		

			<!-- delete -->
					<rich:column>
						<h:commandLink value="#{global.delete}"
							action="#{accessLogMB.deleteAccessLog}">
							 <f:setPropertyActionListener target="#{accessLogMB.accessLog}" value="#{record}" />
						</h:commandLink>
					</rich:column>




				</rich:dataTable>

			

				<h:commandButton actionListener="#{accessLogMB.doCreate}"
					action="accesslog" value="#{global.add}">
					
				</h:commandButton>


			</h:form>
		</f:view>
	</ui:define>

</ui:composition>